#include "MultigridSolverFactory.h"
#include "VC.h"
#include "FMG.h"
#include "VC_1d.h"
#include "FMG_1d.h"

namespace {
	template <size_t DIM>
	MultigridSolver<DIM>* CreateVC(std::string s1, std::string s2) {
		return new VC<DIM>(s1, s2);
	}
	#define DIM 1
	const bool registed_VC_1 =  MultigridSolverFactory<DIM>::Instance()->RegisterMethod("VC", CreateVC);
	#undef DIM
	
	#define DIM 2
	const bool registed_VC_2 =  MultigridSolverFactory<DIM>::Instance()->RegisterMethod("VC", CreateVC);
	#undef DIM


	template <size_t DIM>
	MultigridSolver<DIM>* CreateFMG(std::string s1, std::string s2) {
		return new FMG<DIM>(s1, s2);
	}
	#define DIM 1
	const bool registed_FMG_1 =  MultigridSolverFactory<DIM>::Instance()->RegisterMethod("FMG", CreateFMG);
	#undef DIM

	#define DIM 2
	const bool registed_FMG_2 =  MultigridSolverFactory<DIM>::Instance()->RegisterMethod("FMG", CreateFMG);
	#undef DIM

	template <size_t DIM>
	MultigridSolver<DIM>* CreateVC_1d(std::string s1, std::string s2) {
		return new VC_1d(s1, s2);
	}

	#define DIM 1
	const bool registed_VC_1d =  MultigridSolverFactory<DIM>::Instance()->RegisterMethod("VC_1d", CreateVC_1d);
	#undef DIM
	
	template <size_t DIM>
	MultigridSolver<DIM>* CreateFMG_1d(std::string s1, std::string s2) {
		return new FMG_1d(s1, s2);
	}

	#define DIM 1
	const bool registed_FMG_1d =  MultigridSolverFactory<DIM>::Instance()->RegisterMethod("FMG_1d", CreateFMG_1d);
	#undef DIM
}
